//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing
{
    public class BlendEffect : Effect
    {
        private BlendMode blend;
        private EffectContainer cont;

        public EffectContainer Container
        {
            get { return cont; }
            set { cont = value; }
        }

        public BlendMode Mode
        {
            get { return blend; }
            set { blend = value; }
        }

        internal override void ReadXmlCore(ReadContext context)
        {
            using (var c = context.Read("blend"))
            {
                Mode = c.GetEnum<BlendMode>("blend");
                Container = c.ReadElement<EffectContainer>();
            }
        }

        internal override void WriteXmlCore(WriteContext context)
        {
            using (WriteContext c = context.Write("blend"))
            {
                c.SetEnum("blend", Mode);
                c.WriteElement(Container);
            }
        }
    }
}